using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace goAlarmsCS
{
    /// <summary>
    /// Recurring alarm. Recurrence is defined in minutes or hours
    /// Cannot be snoozed
    /// Reset deactivates until the next occurence.
    /// </summary>
    public class HeartbeatAlarm : Alarm
    {
        private HeartbeatAlarm()
            : base()
        {
            
        }

        public static IAlarm GetAlarm()
        {
            return new HeartbeatAlarm();
        }

        public override void DoSnooze()
        {
            Snoozed = false;
        }

        public override void DoReset()
        {
            SetNextTriggerTime();
        }

        protected override void SetNextTriggerTime()
        {
            NextTriggerTime=NextTriggerTime.AddMinutes(Frequency);
            OnPropertyChanged("NextTriggerTime");
        }

        private AlarmTypes _alarmType = AlarmTypes.Heartbeat;
        protected override AlarmTypes alarmType
        {
            get { return _alarmType; }
        }
    }
}
